<!DOCTYPE html>
<html lang="en">
  <body id="reportsPage" onload="insert_html({{users}}, '{{users_list}}'); {{show_order}}">
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta http-equiv="X-UA-Compatible" content="ie=edge" />
    <title>Staff</title>
    <link
      rel="stylesheet"
      href="https://fonts.googleapis.com/css?family=Roboto:400,700"
    />
    <!-- https://fonts.google.com/specimen/Roboto -->
    <link rel="stylesheet" href="static/css/fontawesome.min.css" />
    <!-- https://fontawesome.com/ -->
    <link rel="stylesheet" href="static/css/bootstrap.min.css" />
    <!-- https://getbootstrap.com/ -->
    <link rel="stylesheet" href="static/css/templatemo-style.css">
    <!--
	Product Admin CSS Template
	https://templatemo.com/tm-524-product-admin
	-->
      <nav class="navbar navbar-expand-xl">
        <div class="container h-100">
          <a class="navbar-brand" href="index.html">
            <h1 class="tm-site-title mb-0">商店端-员工</h1>
          </a>
          <button
            class="navbar-toggler ml-auto mr-0"
            type="button"
            data-toggle="collapse"
            data-target="#navbarSupportedContent"
            aria-controls="navbarSupportedContent"
            aria-expanded="false"
            aria-label="Toggle navigation"
          >
            <i class="fas fa-bars tm-nav-icon"></i>
          </button>

          <div class="collapse navbar-collapse" id="navbarSupportedContent">
            <ul class="navbar-nav mx-auto h-100">
              <li class="nav-item">
                <a class="nav-link" href="index.html">
                  <i class="fas fa-tachometer-alt"></i> 统计信息
                  <span class="sr-only">(current)</span>
                </a>
              </li>

              <li class="nav-item">
              <a class="nav-link" href="product_manage.html">
                <i class="far fa-file-alt"></i>
                商品进货
              </a>
            </li>

              <li class="nav-item">
                <a class="nav-link" href="products.html">
                  <i class="fas fa-shopping-cart"></i> 销售
                </a>
              </li>

              <li class="nav-item">
                <a class="nav-link " href="accounts.html">
                  <i class="far fa-user"></i> 库余量
                </a>
              </li>

              <li class="nav-item dropdown">
                <a
                  class="nav-link dropdown-toggle active"
                  href="#"
                  id="navbarDropdown"
                  role="button"
                  data-toggle="dropdown"
                  aria-haspopup="true"
                  aria-expanded="false"
                >
                  <i class="fas fa-cog"></i>
                    <span> 更新 <i class="fas fa-angle-down"></i> </span>
              </a>
              <div class="dropdown-menu" aria-labelledby="navbarDropdown">
                <a class="dropdown-item" href="add_festival.html">添加节日</a>
                <a class="dropdown-item" href="add_item.html">添加商品</a>
                <a class="dropdown-item" href="add_staff.html">员工管理</a>
              </div>
              </li>
            </ul>
            <ul class="navbar-nav">
              <li class="nav-item">
                <a class="nav-link d-block" href="login.html">
                  Admin, <b>Logout</b>
                </a>
              </li>
            </ul>
          </div>
        </div>
      </nav>
      <div class="container mt-5">
      <div class="row tm-content-row">
        <div class="col-sm-12 tm-block-col">
          <div class="">
            <div class="tm-product-table-container">
              <form action="/check_staff"  method="post" class="">
              <div class="form-group col-lg-6">
                  <label for="staff_no">员工编号/姓名/性别</label>
                  <input
                    id="staff_no"
                    name="staff_no"
                    type="text"
                    class="form-control validate"
                    value="{{temp_value}}"
                  />
                </div>
                    <button
                      type="submit"
                      class="btn btn-primary btn-block text-uppercase"
                    >查询
                    </button>


              <table class="table table-hover tm-table-small tm-product-table">
                <thead>
                  <tr>
                    <th scope="col">员工姓名</th>
                    <th scope="col">员工编号</th>
                    <th scope="col">性别</th>
                    <th scope="col">业绩</th>
                    <th scope="col">等级</th>
                    <th scope="col">薪水</th>
                    <th scope="col">好评率</th>
                  </tr>
                </thead>
                <tbody id="aa"></tbody>
              </table>
              </form>
            </div>
<!--             table container -->
 <div class="">
            <div class="">
              <form action="/add_staffs"  method="post" class="">
              <div class="form-group col-lg-6">
                  <label for="staff_name">姓名</label>
                  <input
                    id="staff_name"
                    name="staff_name"
                    type="text"
                    class="form-control validate"
                  />

                <label for="sex">性别(男/女)</label>
                  <input
                    id="sex"
                    name="sex"
                    type="text"
                    class="form-control validate"
                  />

                </div>
                <div class="form-group col-lg-6">
                    <button
                      type="submit"
                      class="btn btn-primary btn-block text-uppercase"
                    >添加
                    </button>
                 </div>
              </form>

            <!-- table container -->
            </div>
            <form action="/delete_staff"  method="post" class="">
            <div class="form-group col-lg-6">
               <label for="staff_no">员工编号</label>
                  <input
                    id="staff_nos"
                    name="staff_no"
                    type="text"
                    class="form-control validate"
                  />
                 </div>
              <div class="form-group col-lg-6">
                    <button
                      type="submit"
                      class="btn btn-primary btn-block text-uppercase"
                    >移除
                    </button>
                 </div>
            </form>
          </div>
      </div>
      </div>
      </div>
    </div>

    </head>



  <script language="javascript">
function insert_html(Str1, list){
    str = ""
    temp = list.split("!")

    for (i=0;i<Number(Str1);++i){
        k = i.toString()
        tem = temp[i].split(",")


        str = str + "<tr>"
        str = str +  "<td>"+ tem[0] + "</td>&nbsp;"
        str = str +  "<td>"+ tem[1] + "</td>&nbsp;"
        str = str +  "<td>"+ tem[2]  + "</td>&nbsp;"
        str = str +  "<td>"+ tem[3] + "</td>&nbsp;"
        str = str +  "<td>"+ tem[4] + "</td>&nbsp;"
        str = str +  "<td>"+ tem[5] + "</td>&nbsp;"
        str = str +  "<td>"+ tem[6] + "%</td>&nbsp;"
        str = str + "</tr>"
     }
 aa.innerHTML=str;
}
</script>

    <script src="static/js/jquery-3.3.1.min.js"></script>
    <!-- https://jquery.com/download/ -->
    <script src="static/js/bootstrap.min.js"></script>
    <!-- https://getbootstrap.com/ -->
  </body>
</html>
